import { createRouter, createWebHistory } from 'vue-router'
import layout from '@/views/layout/index.vue'
import settingRouter from './modules/setting'
import employeeRouter from './modules/employee'
import department from './modules/department'
const asyncRoutes = [settingRouter, employeeRouter, department]

const routes = [
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/index.vue'),
    hidden: true,
  },
  {
    path: '/',
    redirect: '/dashboard',
    component: layout,
    children: [{
      path: 'dashboard',
      component: () => import('@/views/dashboard/index.vue'),
      meta: {
        title: '数据看板',
        icon: 'HomeOutlined'
      }
    }]
  }
]
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [...routes, ...asyncRoutes]
})

export default router
